<template>
	<view>
		跳转到此页面
	</view>
</template>

<script>
	export default {
		data() {
			return {
				
			}
		},
		onLoad: function (option) {
			console.log('result',JSON.stringify(option))
			if(option.action === 'pdf'){
				this.open_pdf()
			}else if(option.action === 'login'){
				uni.redirectTo({
					url: '/pages/index/authorize'
				})
			}
		},
		methods: {
			
			open_pdf(){
				uni.downloadFile({
					url: 'https://static-b355b199-f26f-4bea-b13c-1b2c8fff663f.bspapp.com/testpdf.pdf', //仅为示例，并非真实的资源
					success: (res) => {
						console.log('下载pdf',res)
						if (res.statusCode === 200) {
							// console.log('下载成功');
							var filePath = res.tempFilePath;
							uni.openDocument({
							  filePath: filePath,
							  showMenu: true,
							  success: function (res) {
								console.log('打开文档成功');
							  }
							});
						}
					}
				});
			}
		}
	}
</script>

<style>

</style>
